package com.ruoyi.mongo.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = { "classpath:config/mongodb_pool.properties","file:./config/mongodb_pool.properties" }, ignoreResourceNotFound = true)
@ConfigurationProperties(prefix = "spring.data.mongodb")
public class MongoSettingsProperties {

	/**
	 *	线程池空闲时保持的最小连接数, 默认是0
	 */
	private int minSize;
	/**
	 *	线程池允许的最大连接数,默认是100
	 */
	private int maxSize;
	/**
	 *	线程等待连接变为可用的最长时间.默认为2分钟. 值为0意味着它不会等待. 负值意味着它将无限期地等待
	 */
	private long maxWaitTime; 
	/**
	 *	线程池中连接的最大空闲时间, 0标志Udine空闲时间没有限制,超过这个时间会被关闭
	 */
	private long maxConnectionIdleTime;
	/**
	 *	线程池中连接的最长生存时间. 0表示没有限制. 超过寿命的会被关闭,必要时通过新连接进行替换
	 */
	private long maxConnectionLifeTime;
	/**
	 *	
	 */
	private long maintenanceInitialDelay;
	/**
	 *	
	 */
	private long maintenanceFrequency;
	
	public int getMinSize() {
		return minSize;
	}
	public void setMinSize(int minSize) {
		this.minSize = minSize;
	}
	public int getMaxSize() {
		return maxSize;
	}
	public void setMaxSize(int maxSize) {
		this.maxSize = maxSize;
	}
	public long getMaxWaitTime() {
		return maxWaitTime;
	}
	public void setMaxWaitTime(long maxWaitTime) {
		this.maxWaitTime = maxWaitTime;
	}
	public long getMaxConnectionIdleTime() {
		return maxConnectionIdleTime;
	}
	public void setMaxConnectionIdleTime(long maxConnectionIdleTime) {
		this.maxConnectionIdleTime = maxConnectionIdleTime;
	}
	public long getMaxConnectionLifeTime() {
		return maxConnectionLifeTime;
	}
	public void setMaxConnectionLifeTime(long maxConnectionLifeTime) {
		this.maxConnectionLifeTime = maxConnectionLifeTime;
	}
	public long getMaintenanceInitialDelay() {
		return maintenanceInitialDelay;
	}
	public void setMaintenanceInitialDelay(long maintenanceInitialDelay) {
		this.maintenanceInitialDelay = maintenanceInitialDelay;
	}
	public long getMaintenanceFrequency() {
		return maintenanceFrequency;
	}
	public void setMaintenanceFrequency(long maintenanceFrequency) {
		this.maintenanceFrequency = maintenanceFrequency;
	}
	
}
